package com.zto.design.command.lightdemo;

/**
 * @program: sch-diy-parent
 * @description:具体关闭电灯的命令
 * @author: sch
 * @create: 2020-11-28 23:40
 **/
public class LightOffCommand implements Command {
    private Light light;

    public LightOffCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.turnOffLight();
    }

    @Override
    public void undo() {
        light.turnOnLight();
    }
}
